package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;

import javax.validation.constraints.NotNull;
import java.util.List;

import static org.jsola.core.example.BaseExample.*;
import static org.jsola.hr.example.ChildCompanyExample.*;
import static org.jsola.core.example.BaseExample.E_ID;
import static org.jsola.core.example.BaseExample.M_ID_NOT_NULL;
import static org.jsola.core.example.BaseExample.N_ID;
import static org.jsola.hr.example.ChildCompanyExample.E_ADDRESS;
import static org.jsola.hr.example.ChildCompanyExample.E_LEVEL;
import static org.jsola.hr.example.ChildCompanyExample.E_PARENT_ID;
import static org.jsola.hr.example.ChildCompanyExample.E_SORT;
import static org.jsola.hr.example.ChildCompanyExample.M_LEVEL_NOT_NULL;
import static org.jsola.hr.example.ChildCompanyExample.M_PARENT_ID_MAX;
import static org.jsola.hr.example.ChildCompanyExample.M_PARENT_ID_NOT_NULL;
import static org.jsola.hr.example.ChildCompanyExample.M_SORT_NOT_NULL;
import static org.jsola.hr.example.ChildCompanyExample.N_LEVEL;
import static org.jsola.hr.example.ChildCompanyExample.N_PARENT_ID;
import static org.jsola.hr.example.ChildCompanyExample.N_SORT;

/**
 * 用工单位分组
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "修改【用工单位分组】的参数")
@Data
public class ChildCompanyUpdateDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_ID, example = E_ID, required = true)
    @NotNull(message = M_ID_NOT_NULL)
    private String id;

    @ApiModelProperty(notes = N_NAME, example = E_NAME, required = true)
    @NotNull(message = M_NAME_NOT_NULL)
    @Length(max = 255, message = M_NAME_MAX)
    private String name;

    @ApiModelProperty(notes = N_ADDRESS, example = E_ADDRESS)
    @Length(max = 255, message = M_ADDRESS_MAX)
    private String address;

    @ApiModelProperty(notes = N_PARENT_ID, example = E_PARENT_ID, required = true)
    @NotNull(message = M_PARENT_ID_NOT_NULL)
    @Length(max = 32, message = M_PARENT_ID_MAX)
    private String parentId;

    @ApiModelProperty(notes = N_SORT, example = E_SORT, required = true)
    @NotNull(message = M_SORT_NOT_NULL)
    private Long sort;

    @ApiModelProperty(notes = N_LEVEL, example = E_LEVEL, required = true)
    @NotNull(message = M_LEVEL_NOT_NULL)
    private Integer level;

    @ApiModelProperty(notes = "是否分管全部的用工单位,true:是,false:否")
    private Boolean isAllCompany;

    @ApiModelProperty(notes = "分管的单位id集合")
    private List<String> managedCompanyList;
}

